package com.niit.mall.common.config;


import com.niit.mall.common.interceptors.UserInfoInterceptors;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @BelongsProject: pardo_mall_backend
 * @BelongsPackage: com.niit.mall.common.config
 * @Author: ChuXuan
 * @CreateTime: 2025-05-29  01:17
 * @Description: MVC配置
 * @Version: 1.0
 */
@Configuration
@ConditionalOnClass(DispatcherServlet.class)
public class MVCConfig implements WebMvcConfigurer {
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new UserInfoInterceptors());
	}
}
